    <!--页面主要内容-->
    <main class="lyear-layout-content">    
      <div class="container-fluid">        
        <div class="row">
          <div class="col-lg-12">
            <div class="card">
              <div class="card-body">            
                <form action="{:url('addpro')}" method="post" class="row" enctype="multipart/form-data">
                  <div class="form-group col-md-12">
                    <label for="type">产品分类</label>
                    <div class="form-controls">
                      <select name="type" class="form-control" id="type">
                      {foreach $data as $key=>$vo}
                        <option value="{$vo['tid']}">{$vo['tname']}</option>
                      {/foreach}
                      </select>
                    </div>
                  </div>
                  <div class="form-group col-md-12">
                    <label for="title">产品名称</label>
                    <input type="text" class="form-control" id="title" name="pname" value="" placeholder="请产品名称" />
                  </div>
                  <div class="form-group col-md-12">
                    <label for="title">产品库存</label>
                    <input type="text" class="form-control" id="title" name="pnum" value="" placeholder="请输入库存" />
                  </div>
                  <div class="form-group col-md-12">
                    <label for="title">产品原价</label>
                    <input type="text" class="form-control" id="title" name="poldprice" value="" placeholder="请输入产品原价" />
                  </div>
                  <div class="form-group col-md-12">
                    <label for="title">产品新价格</label>
                    <input type="text" class="form-control" id="title" name="pnewprice" value="" placeholder="请输入产品新价格" />
                  </div>
                  <div class="form-group col-md-12">
                    <label for="title">每人限购数量</label>
                    <input type="text" class="form-control" id="title" name="pxgnum" value="" placeholder="请输入每人限购数量" />
                  </div>
                  <div class="form-group col-md-12">
                    <label for="title">限购时长</label>
                    <input type="text" class="form-control" id="title" name="pxgtime" value="" placeholder="请输入限购时长" />
                  </div>
                  <div class="form-group col-md-12">
                    <label>缩略图上传</label>
                    <div class="form-controls">                      
                      <ul class="list-inline clearfix lyear-uploads-pic">
                        <li class="col-xs-4 col-sm-3 col-md-2">
                          <figure>
                            <img id="img1" src="__PUBLIC__/images/gallery/15.jpg" alt="图片一">
                            <figcaption>
                              <a class="btn btn-round btn-square btn-primary" href="#!"><i class="mdi mdi-eye"></i></a>
                              <a class="btn btn-round btn-square btn-danger" href="#!"><i class="mdi mdi-delete"></i></a>
                            </figcaption>
                          </figure>
                        </li>
                        <li class="col-xs-4 col-sm-3 col-md-2">
                          <a class="pic-add" id="add-pic-btn" href="#!" title="点击上传"> 
                          </a>
                          <input type="file" id="file" name="pthumb" multiple style="position: relative;top: -90px;;width: 100%;height: 100%;cursor: pointer;opacity: 0" value="点击上传">
                        </li>
                        <li class="col-xs-4 col-sm-3 col-md-2"><label id="text"></label></li>
                      </ul>
                    </div>
                  </div>
                  <div class="form-group col-md-12">
                    <label>轮播图上传</label>
                    <div class="form-controls">                      
                      <ul class="list-inline clearfix lyear-uploads-pic">
                        <li class="col-xs-4 col-sm-3 col-md-2">
                          <figure>
                            <img id="img2" src="__PUBLIC__/images/gallery/15.jpg" alt="图片一">
                            <figcaption>
                              <a class="btn btn-round btn-square btn-primary" href="#!"><i class="mdi mdi-eye"></i></a>
                              <a class="btn btn-round btn-square btn-danger" href="#!"><i class="mdi mdi-delete"></i></a>
                            </figcaption>
                          </figure>
                        </li>
                        <li class="col-xs-4 col-sm-3 col-md-2">
                          <a class="pic-add" id="add-pic-btn" href="#!" title="点击上传">  
                          </a>
                          <input type="file" id="file2" name="bannerimg" multiple style="position: relative;top: -90px;width: 100%;height: 100%;cursor: pointer;opacity: 0;" value="点击上传">
                        </li>
                        <li><label id="text2"></label></li>
                      </ul>
                    </div>
                  </div>                                    
                  <div class="form-group col-md-12">
                    <label for="content">内容</label>                    
                    <!-- 参考文档  http://www.wangeditor.com/doc/pages/01-%E5%BC%80%E5%A7%8B%E4%BD%BF%E7%94%A8/04-%E4%BD%BF%E7%94%A8textarea.html -->
                    <div name="content" id="div1" cols="30" rows="10"></div>
                    <textarea id="content1" name="pdetail" style="width:100%; height:200px;display: none;"></textarea>
                    <script type="text/javascript" src="//unpkg.com/wangeditor/dist/wangEditor.min.js"></script>
                    <script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
                    <script type="text/javascript">
                        const E = window.wangEditor
                        const editor = new E('#div1')
                        const $text1 = $('#content1')
                        
                        // 配置 server 接口地址
                        editor.config.uploadImgServer = '/index/common/upload'
                        // 将图片大小限制为 5M
                        editor.config.uploadImgMaxSize = 5 * 1024 * 1024;
                        // 限制一次最多上传 5 张图片
                        editor.config.uploadImgMaxLength = 5;
                        editor.config.uploadImgParamsWithUrl = true;
                        editor.config.uploadFileName = 'file'
                        editor.config.uploadImgHooks = {
                          customInsert: function (insertImg, result, editor) {
                            // 图片上传并返回结果，自定义插入图片的事件（而不是编辑器自动插入图片！！！）
                            // insertImg 是插入图片的函数，editor 是编辑器对象，result 是服务器端返回的结果
                            console.log(result);
                            // 举例：假如上传图片成功后，服务器端返回的是 {url:'....'} 这种格式，即可这样插入图片：
                            var url =result.data;
                            insertImg(url);
                 
                            // result 必须是一个 JSON 格式字符串！！！否则报错
                          }
                        }
                        //debug模式开启    
                        editor.config.debug = true
                        editor.config.onchange = function (html) {
                            // 第二步，监控变化，同步更新到 textarea
                            $text1.val(html)
                        }
                        editor.create()
                        // 第一步，初始化 textarea 的值
                        $text1.val(editor.txt.html())
                    </script>
                  </div>
                  <div class="form-group col-md-12">
                    <label for="status">商品状态</label>
                    <div class="clearfix">
                      <label class="lyear-radio radio-inline radio-primary">
                        <input type="radio" name="status" value="0"><span>下架</span>
                      </label>
                      <label class="lyear-radio radio-inline radio-primary">
                        <input type="radio" name="status" value="1" checked><span>上架</span>
                      </label>
                    </div>
                  </div>
                  <div class="form-group col-md-12">
                    <button type="submit" class="btn btn-primary ajax-post" target-form="add-form">确 定</button>
                    <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);return false;">返 回</button>
                  </div>
                </form>
       
              </div>
            </div>
          </div>
          
        </div>
        
      </div>
      
    </main>
    <!--End 页面主要内容-->
  </div>
</div>

<script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/bootstrap.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/perfect-scrollbar.min.js"></script>
<!--标签插件-->
<script src="__PUBLIC__/js/jquery-tags-input/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/main.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/self_disimg.js"></script>
</body>
</html>